from django.db import models

# Create your models here.
class Author(models.Model):
    name = models.CharField('姓名',default='',max_length=50)
    def __str__(self):
        return f"{self.id}-{self.name}"

class Book(models.Model):
    title = models.CharField('书名',default='',max_length=50)
    authors=models.ManyToManyField(Author)
    def __str__(self):
        return f"{self.id}-{self.title}"